﻿/* 
 * Godtear.com
 * QQ:bzure@189.cn
 *Author:Nathan Liu
 */
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.IO;

namespace Bzure.Common.Configuration.AppConfiguration
{
    public class AppConfigurationImpl:ConfigurationBase 
    {
        protected static XmlDocument doc;
        static AppConfigurationImpl()
        {
            string path = "bzure.config";
#if COMPACT_FRAMEWORK
                path ="bzure.config";
#else
            path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "bzure.config");
#endif
            doc = new XmlDocument();
            doc.Load(path);
        }
        public AppConfigurationImpl()
        {
            XmlNode root = GetConfigSection("bzure");
            Load(root);
        }
        #region read configuration
        protected XmlNode GetConfigSection(string nodePath)
        {
            return doc.SelectSingleNode(nodePath);
        }
        #endregion  read configuration   
    }
}
